/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * SalesManagers.java
 *
 * Created on Aug 28, 2010, 7:38:39 AM
 */

package GUI;

import BusinessLogic.AdminFunction;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import javax.swing.JOptionPane;
import BusinessLogic.*;
import java.util.Calendar;
import javax.swing.table.TableModel;
//import java.util.*;


/**
 *
 * @author MrDuy
 */
public class SalesManagers extends javax.swing.JPanel {

    /** Creates new form SalesManagers */
    private User user;
    private SalesManagerFunction_BL salesManager;
    public SalesManagers(User userObj) {
        salesManager = new SalesManagerFunction_BL();
        user = userObj;
        initComponents();
        txtName.setText(user.getName());
        txtPhone.setText(user.getPhone());
        txtEmail.setText(user.getEmail());
        txtAddress.setText(user.getAddress());
        txtUserName.setText(user.getUserName());
        txtRoles.setText(user.getRole());
        txtPer.setText(Integer.toString(user.getPermiss()));
        setDateNow();
    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        pnInfor = new javax.swing.JPanel();
        pn_PersonInfo = new javax.swing.JPanel();
        lb_Address = new javax.swing.JLabel();
        lb_phone = new javax.swing.JLabel();
        lb_Email = new javax.swing.JLabel();
        txtPhone = new javax.swing.JTextField();
        txtEmail = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        txtAddress = new javax.swing.JTextArea();
        bnt_Change = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        txtName = new javax.swing.JTextField();
        pn_MangerInfo = new javax.swing.JPanel();
        lb_username = new javax.swing.JLabel();
        lb_Roles = new javax.swing.JLabel();
        lb_permis = new javax.swing.JLabel();
        txtUserName = new javax.swing.JTextField();
        txtRoles = new javax.swing.JTextField();
        txtPer = new javax.swing.JTextField();
        bntChangePass = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jpView1 = new javax.swing.JPanel();
        lbViewBill = new javax.swing.JLabel();
        lbViewMoney = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        txtViewBills = new javax.swing.JTextField();
        txtViewMoney = new javax.swing.JTextField();
        txtViewBillscancel = new javax.swing.JTextField();
        btViewBillsCancel = new javax.swing.JButton();
        btViewBills = new javax.swing.JButton();
        btViewBillMoney = new javax.swing.JButton();
        txtViewItemAvailable = new javax.swing.JTextField();
        btViewItemCancel = new javax.swing.JButton();
        btViewItemNotAvailable = new javax.swing.JButton();
        txtViewItemCancel = new javax.swing.JTextField();
        btViewGraphs = new javax.swing.JButton();
        lbViewItemcalce = new javax.swing.JLabel();
        lbViewItemNotAvailable = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbListView = new javax.swing.JTable();

        setBorder(javax.swing.BorderFactory.createEtchedBorder());

        pn_PersonInfo.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Personal Information", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 18))); // NOI18N

        lb_Address.setText("Address :");

        lb_phone.setText("Phone :");

        lb_Email.setText("Email :");

        txtAddress.setColumns(20);
        txtAddress.setRows(5);
        jScrollPane2.setViewportView(txtAddress);

        bnt_Change.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/Edit-icon.png"))); // NOI18N
        bnt_Change.setText("Update");
        bnt_Change.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bnt_ChangeActionPerformed(evt);
            }
        });

        jLabel2.setText("Name :");

        org.jdesktop.layout.GroupLayout pn_PersonInfoLayout = new org.jdesktop.layout.GroupLayout(pn_PersonInfo);
        pn_PersonInfo.setLayout(pn_PersonInfoLayout);
        pn_PersonInfoLayout.setHorizontalGroup(
            pn_PersonInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pn_PersonInfoLayout.createSequentialGroup()
                .add(pn_PersonInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, pn_PersonInfoLayout.createSequentialGroup()
                        .addContainerGap()
                        .add(pn_PersonInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(lb_Address)
                            .add(lb_phone))
                        .add(18, 18, 18)
                        .add(pn_PersonInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(txtPhone, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE)
                            .add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE)
                            .add(txtEmail, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE)
                            .add(txtName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE)))
                    .add(org.jdesktop.layout.GroupLayout.LEADING, pn_PersonInfoLayout.createSequentialGroup()
                        .add(106, 106, 106)
                        .add(bnt_Change)))
                .add(33, 33, 33))
            .add(pn_PersonInfoLayout.createSequentialGroup()
                .addContainerGap()
                .add(lb_Email)
                .addContainerGap(247, Short.MAX_VALUE))
            .add(pn_PersonInfoLayout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel2)
                .addContainerGap(244, Short.MAX_VALUE))
        );
        pn_PersonInfoLayout.setVerticalGroup(
            pn_PersonInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pn_PersonInfoLayout.createSequentialGroup()
                .add(25, 25, 25)
                .add(pn_PersonInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel2)
                    .add(txtName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(39, 39, 39)
                .add(pn_PersonInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(lb_phone)
                    .add(txtPhone, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(45, 45, 45)
                .add(pn_PersonInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, txtEmail, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, lb_Email))
                .add(39, 39, 39)
                .add(pn_PersonInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(pn_PersonInfoLayout.createSequentialGroup()
                        .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 83, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(46, 46, 46)
                        .add(bnt_Change))
                    .add(lb_Address))
                .add(11, 11, 11))
        );

        pn_MangerInfo.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Management Information", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 18))); // NOI18N

        lb_username.setText("UserName :");

        lb_Roles.setText("Roles :");

        lb_permis.setText("Permisson :");

        txtUserName.setEditable(false);

        txtRoles.setEditable(false);

        txtPer.setEditable(false);

        bntChangePass.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/Edit-icon.png"))); // NOI18N
        bntChangePass.setText("Change Password");
        bntChangePass.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bntChangePassActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout pn_MangerInfoLayout = new org.jdesktop.layout.GroupLayout(pn_MangerInfo);
        pn_MangerInfo.setLayout(pn_MangerInfoLayout);
        pn_MangerInfoLayout.setHorizontalGroup(
            pn_MangerInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pn_MangerInfoLayout.createSequentialGroup()
                .add(30, 30, 30)
                .add(pn_MangerInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(lb_username)
                    .add(lb_Roles)
                    .add(lb_permis))
                .add(49, 49, 49)
                .add(pn_MangerInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(txtUserName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE)
                    .add(txtRoles)
                    .add(txtPer))
                .addContainerGap(14, Short.MAX_VALUE))
            .add(org.jdesktop.layout.GroupLayout.TRAILING, pn_MangerInfoLayout.createSequentialGroup()
                .addContainerGap(82, Short.MAX_VALUE)
                .add(bntChangePass, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 174, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(48, 48, 48))
        );
        pn_MangerInfoLayout.setVerticalGroup(
            pn_MangerInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pn_MangerInfoLayout.createSequentialGroup()
                .add(28, 28, 28)
                .add(pn_MangerInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(lb_username)
                    .add(txtUserName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(37, 37, 37)
                .add(pn_MangerInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(lb_Roles)
                    .add(txtRoles, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(42, 42, 42)
                .add(pn_MangerInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(lb_permis)
                    .add(txtPer, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 174, Short.MAX_VALUE)
                .add(bntChangePass)
                .addContainerGap())
        );

        org.jdesktop.layout.GroupLayout pnInforLayout = new org.jdesktop.layout.GroupLayout(pnInfor);
        pnInfor.setLayout(pnInforLayout);
        pnInforLayout.setHorizontalGroup(
            pnInforLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pnInforLayout.createSequentialGroup()
                .add(22, 22, 22)
                .add(pn_PersonInfo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(49, 49, 49)
                .add(pn_MangerInfo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(104, Short.MAX_VALUE))
        );
        pnInforLayout.setVerticalGroup(
            pnInforLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pnInforLayout.createSequentialGroup()
                .add(24, 24, 24)
                .add(pnInforLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(pn_MangerInfo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(pn_PersonInfo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(55, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Information", new javax.swing.ImageIcon(getClass().getResource("/Images/Information-icon.png")), pnInfor); // NOI18N

        jpView1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jpView1.setLayout(null);

        lbViewBill.setText("View Bills:");
        jpView1.add(lbViewBill);
        lbViewBill.setBounds(50, 20, 70, 20);

        lbViewMoney.setText("View Money:");
        jpView1.add(lbViewMoney);
        lbViewMoney.setBounds(30, 80, 80, 20);

        jLabel1.setText("View Bills Cancel:");
        jpView1.add(jLabel1);
        jLabel1.setBounds(10, 140, 100, 20);

        txtViewBills.setEditable(false);
        jpView1.add(txtViewBills);
        txtViewBills.setBounds(120, 20, 150, 20);

        txtViewMoney.setEditable(false);
        jpView1.add(txtViewMoney);
        txtViewMoney.setBounds(120, 80, 150, 20);

        txtViewBillscancel.setEditable(false);
        jpView1.add(txtViewBillscancel);
        txtViewBillscancel.setBounds(120, 140, 150, 20);

        btViewBillsCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/1283060576_eye.png"))); // NOI18N
        btViewBillsCancel.setText("View");
        btViewBillsCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btViewBillsCancelActionPerformed(evt);
            }
        });
        jpView1.add(btViewBillsCancel);
        btViewBillsCancel.setBounds(280, 140, 80, 25);

        btViewBills.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/1283060576_eye.png"))); // NOI18N
        btViewBills.setText("View");
        btViewBills.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btViewBillsActionPerformed(evt);
            }
        });
        jpView1.add(btViewBills);
        btViewBills.setBounds(280, 20, 80, 25);

        btViewBillMoney.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/1283060576_eye.png"))); // NOI18N
        btViewBillMoney.setText("View");
        btViewBillMoney.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btViewBillMoneyActionPerformed(evt);
            }
        });
        jpView1.add(btViewBillMoney);
        btViewBillMoney.setBounds(280, 80, 80, 25);

        txtViewItemAvailable.setEditable(false);
        jpView1.add(txtViewItemAvailable);
        txtViewItemAvailable.setBounds(480, 20, 160, 20);

        btViewItemCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/1283060576_eye.png"))); // NOI18N
        btViewItemCancel.setText("View");
        btViewItemCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btViewItemCancelActionPerformed(evt);
            }
        });
        jpView1.add(btViewItemCancel);
        btViewItemCancel.setBounds(650, 80, 90, 25);

        btViewItemNotAvailable.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/1283060576_eye.png"))); // NOI18N
        btViewItemNotAvailable.setText("View");
        btViewItemNotAvailable.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btViewItemNotAvailableActionPerformed(evt);
            }
        });
        jpView1.add(btViewItemNotAvailable);
        btViewItemNotAvailable.setBounds(650, 20, 90, 25);

        txtViewItemCancel.setEditable(false);
        jpView1.add(txtViewItemCancel);
        txtViewItemCancel.setBounds(480, 80, 160, 20);

        btViewGraphs.setText("Sales-Trend Graphs");
        btViewGraphs.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btViewGraphsActionPerformed(evt);
            }
        });
        jpView1.add(btViewGraphs);
        btViewGraphs.setBounds(530, 140, 150, 23);

        lbViewItemcalce.setText("Item Cancel:");
        jpView1.add(lbViewItemcalce);
        lbViewItemcalce.setBounds(400, 80, 80, 20);

        lbViewItemNotAvailable.setText("Items not available:");
        jpView1.add(lbViewItemNotAvailable);
        lbViewItemNotAvailable.setBounds(370, 20, 110, 20);

        tbListView.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(tbListView);

        org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 771, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jpView1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 771, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .add(jpView1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 204, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(33, 33, 33)
                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 240, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Sales Management", new javax.swing.ImageIcon(getClass().getResource("/Images/User-icon.png")), jPanel2); // NOI18N

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jTabbedPane1)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 545, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btViewBillsCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btViewBillsCancelActionPerformed
        // TODO add your handling code here:
        
        TableModel modelViewbill = salesManager.getModelTable_BL(1);
        tbListView.setModel(modelViewbill);
}//GEN-LAST:event_btViewBillsCancelActionPerformed

    private void btViewBillsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btViewBillsActionPerformed
        // TODO add your handling code here:
        TableModel modelViewbill = salesManager.getModelTable_BL(2);
        tbListView.setModel(modelViewbill);
}//GEN-LAST:event_btViewBillsActionPerformed

    private void btViewBillMoneyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btViewBillMoneyActionPerformed
        // TODO add your handling code here:
        TableModel modelViewbill = salesManager.getModelTable_BL(3);
        tbListView.setModel(modelViewbill);
}//GEN-LAST:event_btViewBillMoneyActionPerformed

    private void bnt_ChangeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnt_ChangeActionPerformed
        // TODO add your handling code here:
        if(ValidateInfoForm()==1) {
            String message = new AdminFunction().updateInfor_BL(user.getUserID(),txtName.getText(),txtPhone.getText(),txtEmail.getText(),txtAddress.getText());
            JOptionPane.showMessageDialog(this, message);
        }
}//GEN-LAST:event_bnt_ChangeActionPerformed

    private void bntChangePassActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bntChangePassActionPerformed
        // TODO add your handling code here:
        new ChangePass(user).setVisible(true);
}//GEN-LAST:event_bntChangePassActionPerformed

    private void btViewItemNotAvailableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btViewItemNotAvailableActionPerformed
        // TODO add your handling code here:
        TableModel modelViewbill = salesManager.getModelTable_BL(4);
        tbListView.setModel(modelViewbill);
    }//GEN-LAST:event_btViewItemNotAvailableActionPerformed

    private void btViewItemCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btViewItemCancelActionPerformed
        // TODO add your handling code here:
        TableModel modelViewbill = salesManager.getModelTable_BL(5);
        tbListView.setModel(modelViewbill);
    }//GEN-LAST:event_btViewItemCancelActionPerformed

    private void btViewGraphsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btViewGraphsActionPerformed
        // TODO add your handling code here:
        
    }//GEN-LAST:event_btViewGraphsActionPerformed

    public void setDateNow()
    {
        txtViewBills.setText(getDate());
        txtViewMoney.setText(getDate());
        txtViewBillscancel.setText(getDate());
        txtViewItemAvailable.setText(getDate());
        txtViewItemCancel.setText(getDate());
    }

    public String getDate()
    {
        Calendar cal = Calendar.getInstance();
        SimpleDateFormat sd = new SimpleDateFormat("MM/dd/yyyy");
        String dateNow = (String)sd.format(cal.getTime());
        return dateNow;
    }
    public int ValidateInfoForm()
    {
        InfoName=txtName.getText();
        InfoPhone=txtPhone.getText();
        InfoEmail=txtEmail.getText();
        InfoAddress=txtAddress.getText();
        InfoUserName=txtUserName.getText();
        InfoRoles=txtRoles.getText();
        String per=txtPer.getText();
        if(InfoName.equals(""))
        {
            JOptionPane.showMessageDialog(this,"Enter Your Name !","Error !",2,null);
            txtName.requestFocus();
            return 0;
        }
        else if(InfoPhone.equals(""))
        {
            JOptionPane.showMessageDialog(this,"Enter Your Phone Number !","Error !",2,null);
            txtPhone.requestFocus();
            return 0;
        }
        else if(InfoEmail.equals(""))
        {
            JOptionPane.showMessageDialog(this,"Enter Your Contac Email !","Error !",2,null);
            txtEmail.requestFocus();
            return 0;
        }
        else if(InfoAddress.equals(""))
        {
            JOptionPane.showMessageDialog(this,"Enter Your Address !","Error !",2,null);
            txtAddress.requestFocus();
            return 0;
        }
        return 1;
    }

//variable for Information form
    private String InfoName;
    private String InfoPhone;
    private String InfoEmail;
    private String InfoAddress;
    private String InfoUserName;
    private String InfoRoles;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bntChangePass;
    private javax.swing.JButton bnt_Change;
    private javax.swing.JButton btViewBillMoney;
    private javax.swing.JButton btViewBills;
    private javax.swing.JButton btViewBillsCancel;
    private javax.swing.JButton btViewGraphs;
    private javax.swing.JButton btViewItemCancel;
    private javax.swing.JButton btViewItemNotAvailable;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JPanel jpView1;
    private javax.swing.JLabel lbViewBill;
    private javax.swing.JLabel lbViewItemNotAvailable;
    private javax.swing.JLabel lbViewItemcalce;
    private javax.swing.JLabel lbViewMoney;
    private javax.swing.JLabel lb_Address;
    private javax.swing.JLabel lb_Email;
    private javax.swing.JLabel lb_Roles;
    private javax.swing.JLabel lb_permis;
    private javax.swing.JLabel lb_phone;
    private javax.swing.JLabel lb_username;
    private javax.swing.JPanel pnInfor;
    private javax.swing.JPanel pn_MangerInfo;
    private javax.swing.JPanel pn_PersonInfo;
    private javax.swing.JTable tbListView;
    private javax.swing.JTextArea txtAddress;
    private javax.swing.JTextField txtEmail;
    private javax.swing.JTextField txtName;
    private javax.swing.JTextField txtPer;
    private javax.swing.JTextField txtPhone;
    private javax.swing.JTextField txtRoles;
    private javax.swing.JTextField txtUserName;
    private javax.swing.JTextField txtViewBills;
    private javax.swing.JTextField txtViewBillscancel;
    private javax.swing.JTextField txtViewItemAvailable;
    private javax.swing.JTextField txtViewItemCancel;
    private javax.swing.JTextField txtViewMoney;
    // End of variables declaration//GEN-END:variables

}
